﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Akso.Infrastructure.Data.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akso.Entities
{
    /// <summary>
    /// 新生入学采购订单项目-订单子表1
    /// </summary>
    [Table("Stu_StudentOrderItems")]
    public class StudentOrderItem : FullAuditedEntity<Guid>
    {
        public const int MaxNameLength = 50;
        public const int MaxUnitsLength = 20;

        /// <summary>
        /// 外键，对应新学员报名表主键Id
        /// </summary>
        public Guid StudentOrderId { get; set; }
        [ForeignKey("StudentOrderId")]
        public virtual StudentOrder StudentOrder { get; set; }

        [Description("项目名称")]
        [MaxLength(MaxNameLength)]
        public virtual string ItemName { get; set; }
        [Description("原单价")]
        [DecimalPrecision(10, 2)]
        public virtual decimal Price { get; set; }
        [Description("数量")]
        public virtual int Number { get; set; }
        [Description("单位")]
        [MaxLength(MaxUnitsLength)]
        public virtual string Units { get; set; }
        [Description("折扣%")]
        public virtual int Discount { get; set; }
        [Description("折扣后单价")]
        [DecimalPrecision(10, 2)]
        public virtual decimal DiscountPrice { get; set; }
        [Description("金额")]
        [DecimalPrecision(10, 2)]
        public virtual decimal Amount { get; set; }
        [Description("赠送数量")]
        public virtual int GiveNumber { get; set; }
        /// <summary>
        /// 如果打钩，你输入了直减优惠金额后，该优惠金额会分摊到打勾的收费项目里。
        /// </summary>
        [Description("分摊")]
        public virtual bool IsShare { get; set; }

    }
}
